package cn.buddha.jest.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @ClassName DBUtils
 * @Author 友野浩二
 * @Date 2020/3/15 17:02
 * @Description 数据库连接工具类
 * @Version 1.0
 */
public class DBUtils {

    public static Connection getConnection() throws SQLException {
        try {
            Class.forName("com.mysql.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return DriverManager.getConnection(
                "jdbc:mysql://127.0.0.1:3306/ifptest?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8",
                "root",
                "root");
    }

}
